package net.golfklubi.sive;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

public class XStreamFactory {

    private static XStream xstream;

    public static XStream getObjectInstance() {
        return xstream;
    }

    public void init() {
        xstream = new XStream(new DomDriver());
        xstream.registerConverter(new MySinglevalueConverter());
        setXmlMappings();
    }

    private void setXmlMappings() {
        xstream.alias("competition", Competition.class);
    }

}
